package com.jack.mvvmexample//package com.jack.mvvmexample
//
//import android.view.LayoutInflater
//import android.view.View
//import android.view.ViewGroup
//import androidx.databinding.DataBindingUtil
//import androidx.databinding.ViewDataBinding
//import androidx.recyclerview.widget.RecyclerView
//
//class SceneryAdapter : RecyclerView.Adapter<SceneryAdapter.ItemHolder>{
//
//    private var mDatas : MutableList<SceneryData>
//
//    constructor(mData:MutableList<SceneryData>) : super(){
//        this.mDatas = mData
//    }
//
//
//    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
//        var itemView = LayoutInflater.from(parent.context).inflate(R.layout.item_simple_list,parent,false);
//        var mHolder = ItemHolder(itemView)
//        return mHolder;
//    }
//
//    override fun getItemCount(): Int {
//        return mDatas.size
//    }
//
//    override fun onBindViewHolder(holder: ItemHolder, position: Int){
//        holder.mBinding.setVariable(BR.scenery,mDatas[position])
//        holder.mBinding.executePendingBindings()
//    }
//
//    inner class ItemHolder : RecyclerView.ViewHolder{
//          var mBinding : ViewDataBinding;
//
//        constructor(itemView: View) : super(itemView){
//            val mContext = itemView.context
//            mBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext),R.layout.item_simple_list,null,false)
//        }
//    }
//
//    fun setNewData(data : MutableList<SceneryData>){
//        this.mDatas = data;
//        this.notifyDataSetChanged()
//    }
//}